home *** CD-ROM | disk | FTP | other *** search
/ BMUG Revelations / BMUG Revelations.toast / Programming / Programming Languages / Harvest C / MPW Int & Lib / Interfaces / DisAsmLookup.h < prev    next >
Text File  |  1991-04-17  |  23KB  |  491 lines

  1. /************************************************************
  2.  
  3. Created: Wednesday, November 1, 1989
  4.     DisAsmLookup.h
  5.     C Interface to the Macintosh Libraries
  6.  
  7.  
  8.     Copyright Apple Computer, Inc. 1987-1990
  9.     All rights reserved
  10.  
  11. ************************************************************/
  12.  
  13.  
  14. #ifndef __DISASMLOOKUP__
  15. #define __DISASMLOOKUP__
  16.  
  17. #ifndef __TYPES__
  18. #include <Types.h>
  19. #endif
  20.  
  21.  
  22. typedef enum {_A0_, _A1_, _A2_, _A3_, _A4_, _A5_, _A6_, _A7_, _PC_, _ABS_, _TRAP_, _IMM_} LookupRegs;
  23.         
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27.  
  28. /*----------------------------------------------------------------------------*/
  29.  
  30. pascal void Disassembler(long     DstAdjust,                 /* Address correction                    */
  31.                                                  short *BytesUsed,             /* Bytes used up by 1 call        */  
  32.                                                  Ptr     FirstByte,                /* Ptr to 1st byte                        */
  33.                                                  char     *Opcode,                     /* Ptr to opcode string         */
  34.                                                  char     *Operand,                 /* Ptr to operand string        */
  35.                                                  char     *Comment,                 /* Ptr to comment string         */
  36.                                                   Ptr     LookUpProc);            /* Ptr to PASCAL proc or NULL    */
  37.     /*
  38.     Disassembler is a Pascal routine to be called to disassemble a sequence of
  39.     bytes.  All MC68xxx, MC68881, and MC68851 instructions are supported.  The
  40.     sequence of bytes to be disassembled are pointed to by FirstByte.  BytesUsed
  41.     bytes starting at FirstByte are consumed by the disassembly, and the Opcode,
  42.     Operand, and Comment strings returned as NULL TERMINATED Pascal strings (for
  43.     easier manipulation with C).  The caller is then free to format or use the
  44.     output strings any way appropriate to the application.
  45.  
  46.     Depending on the opcode and effective address(s) (EA's) to be disassembled,
  47.     the Opcode, Operand, and Comment strings contain the following information:
  48.     
  49.     Case                     Opcode    Operand    Comment
  50.     =======================================================================
  51.     Non PC-relative EA's     op.sz     EA's                ; 'c…' (for immediates)
  52.     PC-relative EA's         op.sz     EA's       ; address
  53.     Toolbox traps            DC.W      $AXXX      ; TB XXXX
  54.     OS traps                 DC.W      $AXXX      ; OS XXXX
  55.     Invalid bytes            DC.W      $XXXX      ; ????
  56.     =======================================================================
  57.     
  58.     For valid disassembly of processor instructions the appropriate MC68XXX
  59.     opcode mnemonic is generated for the Opcode string along with a size
  60.     attribute when required. The source and destination EA's are generated as the
  61.     Operand along with a possible comment.  Comments start with a ';'.  Traps use
  62.     a DC.W assembler directive as the Opcode with the trap word as the Operand
  63.     and a comment indicating whether the trap is a toolbox or OS trap and what
  64.     the trap number is.  As described later the caller can generate symbolic
  65.     substitutions into EA's and provide names for traps.
  66.  
  67.     Invalid instructions cause the string 'DC.W' to be returned in the Opcode
  68.     string. Operand is '$XXXX' (the invalid word) with a comment of '; ????'.
  69.   BytesUsed is 2. This is similar to the trap call case except for the comment.
  70.  
  71.     Note, the Operand EA's is syntatically similar to but NOT COMPATIBLE with the
  72.     MPW assembler!    This is because the Disassembler generates byte hex constants
  73.     as "$XX" and word hex constants as "$XXXX".  Negative values (e.g., $FF or
  74.     $FFFF) produced by the Disassembler are treated as long word values by the MPW
  75.     assembler.  Thus it is assumed that Disassembler output will NOT be used as
  76.     MPW assembler input. If that is the goal, then the caller must convert strings
  77.     of the form $XX or $XXXX in the Operand string to their decimal equivalent.
  78.     The routine ModifyOperand is provided in this unit to aid with the conversion
  79.     process.
  80.  
  81.     Since a PC-relative comment is an address, the only address that the
  82.     Disassembler knows about is the address of the code pointed to by FirstByte.
  83.   Generally, that may be a buffer that has no relation to "reality", i.e., the
  84.     actual code loaded into the buffer.  Therefore, to allow the address comment
  85.     to be mapped back to some actual address the caller may specify an adjustment
  86.     factor, specified by DstAdjust that is ADDED to the value that normally would
  87.     be placed in the comment.
  88.  
  89.     Operand effective address strings are generated as a function of the 
  90.     effective address mode and a special case is made for A-trap opcode strings.
  91.     In places where a possible symbolic reference could be substituted for an
  92.     address (or a portion of an address), the Disassembler can call a user
  93.     specified routine to do the substitution (using th LookupProc parameter
  94.     described later).  The following table summarizes the generated effective
  95.     addresses and where symbolic substitutions (S) can be made:
  96.              
  97.     Mode    Generated Effective Address  Effective Address with Substitution
  98.   ========================================================================
  99.         0     Dn                           Dn
  100.         1     An                           An
  101.         2     (An)                         (An)
  102.         3     (An)+                        (An)+
  103.         4     -(An)                        -(An)
  104.         5     ∂(An)                        S(An) or just S (if An=A5, ∂≥0)
  105.      6n     ∂(An,Xn.Size*Scale)          S(An,Xn.Size*Scale)
  106.      6n     (BD,An,Xn.Size*Scale)        (S,An,Xn.Size*Scale)
  107.      6n     ([BD,An],Xm.Size*Scale,OD)   ([S,An],Xm.Size*Scale,OD)
  108.      6n     ([BD,An,Xn.Size*Scale],OD)   ([S,An,Xn.Size*Scale],OD)
  109.      70     ∂                            S
  110.      71     ∂                            S
  111.      72     *±∂                          S
  112.      73     *±∂(Xn.Size*Scale)           S(Xn.Size*Scale)
  113.      73     (*±∂,Xn.Size*Scale)          (S,Xn.Size*Scale)
  114.      73     ([*±∂],Xm.Size*Scale,OD)     ([S],Xm.Size*Scale,OD)
  115.      73     ([*±∂,Xn.Size*Scale],OD)     ([S,Xn.Size*Scale],OD)
  116.      74     #data                        S (#data made comment)
  117.     A-traps $AXXX                        S (as opcode, AXXX made comment)
  118.   ========================================================================
  119.  
  120.   For A-traps, the substitution can be performed to substitute for the DC.W
  121.     opcode string.  If the substitution is made then the Disassembler will
  122.     generate ,Sys and/or ,Immed flags as operands for Toolbox traps and
  123.     ,AutoPop for OS traps when the bits in the trap word indicates these
  124.     settings.
  125.     
  126.                     |         Generated          |            Substituted
  127.                     | Opcode  Operand  Comment   | Opcode  Operand        Comment
  128.   ========================================================================
  129.     Toolbox | DC.W    $AXXX    ; TB XXXX | S       [,Sys][,Immed] ; AXXX
  130.     OS      | DC.W    $AXXX    ; OS XXXX | S       [,AutoPop]     ; AXXX
  131.   ========================================================================
  132.  
  133.     All displacements (∂, BD, OD) are hexadecimal values shown as a byte ($XX),
  134.     word ($XXXX), or long ($XXXXXXXX) as appropriate. The *Scale is suppressed if
  135.     1. The Size is W or L.  Note that effective address substitutions can only be
  136.     made for "∂(An)", "BD,An", and "*±∂" cases.
  137.             
  138.     For all the effective address modes 5, 6n, 7n, and for A-traps, a coroutine (a
  139.     procedure) whose address is specified by the LookupProc parameter is called by
  140.     the Disassembler (if LookupProc is not NIL) to do the substitution (or A-trap
  141.     comment) with a string returned by the proc.  It is assumed that the proc
  142.     pointed to by LookupProc is a level 1 Pascal proc declared as follows:
  143.  
  144.     PROCEDURE Lookup(         PC:      UNIV Ptr;     {Addr of extension/trap word}
  145.                                              BaseReg: LookupRegs;   {Base register/lookup mode  }
  146.                                              Opnd:    UNIV LongInt; {Trap word, PC addr, disp.  }
  147.                                      VAR S:       Str255);             {Returned substitution      }
  148.         
  149.     or in C,
  150.     
  151.     pascal void LookUp(Ptr         PC, 
  152.                        LookupRegs  BaseReg, 
  153.                                          long        Opnd, 
  154.                                          char        *S); 
  155.  
  156.     PC      = Pointer to instruction extension word or A-trap word in the
  157.                         buffer pointed to by the Disassembler's FirstByte parameter.
  158.                         
  159.     BaseReg = This determines the meaning of the Opnd value and supplies
  160.                         the base register for the "∂(An)", "BD,An", and "*±∂" cases.
  161.                         BaseReg may contain any one of the following values:
  162.                      
  163.                         _A0_    =  0 ==> A0
  164.                         _A1_    =  1 ==> A1
  165.                         _A2_    =  2 ==> A2
  166.                         _A3_    =  3 ==> A3
  167.                         _A4_    =  4 ==> A4
  168.                         _A5_    =  5 ==> A5
  169.                         _A6_    =  6 ==> A6
  170.                         _A7_    =  7 ==> A7
  171.                         _PC_    =  8 ==> PC-relative (special case)
  172.                         _ABS_   =  9 ==> Abs addr    (special case)
  173.                         _TRAP_  = 10 ==> Trap word   (special case)
  174.                   _IMM_        = 11 ==> Immediate   (special case)
  175.                         
  176.                         For absolute addressing (modes 70 and 71), BaseReg contains _ABS_.
  177.                         For A-traps, BaseReg would contain _TRAP_.  For immediate data (mode
  178.                         74), BaseReg would contain _IMM_.
  179.  
  180.     Opnd    = The contents of this LongInt is determined by the BaseReg parameter
  181.                         just described.
  182.                  
  183.                         For BaseReg = _IMM_ (immediate data):
  184.                               Opnd contains the (extended) 32-bit immediate data specified by
  185.                                 the instruction.
  186.  
  187.                         For BaseReg = _TRAP_ (A-traps):
  188.                                 Opnd is the entire trap word. The high order 16 bits of Opnd are
  189.                                 zero.
  190.  
  191.                         For BaseReg = _ABS_  (absolute effective address):
  192.                                 Opnd contains the (extended) 32-bit address specifed by the
  193.                                 instruction's effective address.  Such addresses would generally
  194.                                 be used to reference low memory globals on a Macintosh.
  195.  
  196.                         For BaseReg = _PC_  (PC-relative effective address):
  197.                                 Opnd contains the 32-bit address represented by "*±∂" adjusted
  198.                                 by the Disassembler's DstAdjust parameter.
  199.                                 
  200.                         For BaseReg = _An_  (effective address with a base register):
  201.                                 Opnd contains the (sign-extended) 32-bit (base) displacement
  202.                                 from the instruction's effective address.
  203.                                 
  204.                                 In the Macintosh environment, a BaseReg specifying A5 implies
  205.                                 either global data references or Jump Table references. Positive
  206.                                 Opnd values with an A5 BaseReg thus mean Jump Table references,
  207.                                 while a negative offset would mean a global data reference.
  208.                                 Base registers of A6 or A7 would usually mean local data.
  209.  
  210.     S       = Pascal string returned from Lookup containing the effective address
  211.                         substitution string or a trap name for A-traps.  S is set to null
  212.                         PRIOR to calling Lookup.  If it is still null on return, the string
  213.                         is not used.  If not null, then for A-traps, the returned string is
  214.                         used as a opcode string. In all other cases the string is
  215.                         substituted as shown in the above table.
  216.                          
  217.     Depending on the application, the caller has three choices on how to use the
  218.     Disassembler and an associated Lookup proc:
  219.  
  220.     (1). The caller can call just the Disassembler and provide his own Lookup
  221.              proc. In that case the calling conventions discussed above must be
  222.              followed.
  223.  
  224.     (2). The caller can provide NIL for the LookupProc parameter, in which case,
  225.              NO Lookup proc will be called.
  226.              
  227.     (3). The caller can call first InitLookup (described below, a proc provided
  228.              with this unit) and pass the address of this unit's standard Lookup proc
  229.              when Disassembler is called.    In this case all the control logic to
  230.              determine the kind of substitution to be done is provided for the caller
  231.              and all that need to be provided by the user are routines to look up any
  232.              or all of the following:
  233.              
  234.              • PC-relative references
  235.              • Jump Table references
  236.              • Absolute address references
  237.              • Trap names
  238.              • Immediate data names
  239.              • References with offsets from base registers                                                    */
  240.                 
  241.  
  242. pascal void InitLookup(Ptr PCRelProc, Ptr JTOffProc, Ptr TrapProc,
  243.                                              Ptr AbsAddrProc, Ptr IdProc, Ptr ImmDataProc);
  244.     /*
  245.     Prepare for use of this unit's Lookup proc.  When Disassembler is called
  246.     and the address of this unit's Lookup proc is specified, then for immeduate 
  247.     data, PC-relative, Jump Table references, A-traps, absolute addresses, and
  248.     offsets from a base register, the associated level 1 Pascal proc specified
  249.     here is called (if not NULL -- all five addresses are preset to NULL). The
  250.     calls assume the following declarations for these procs (see Lookup, below
  251.     for further details):
  252.                                                              
  253.     PROCEDURE PCRelProc(Address: UNIV LongInt;
  254.                                             VAR S:     UNIV Str255);
  255.  
  256.     PROCEDURE JTOffProc(A5JTOffset: UNIV Integer;
  257.                                             VAR S:        UNIV Str255);
  258.  
  259.     PROCEDURE TrapNameProc(TrapWord: UNIV Integer;
  260.                                                  VAR S:       UNIV Str255);
  261.                                                     
  262.     PROCEDURE AbsAddrProc(AbsAddr: UNIV LongInt;
  263.                                                 VAR S:     UNIV Str255);
  264.  
  265.     PROCEDURE IdProc(BaseReg: LookupRegs;
  266.                                      Offset:  UNIV LongInt;
  267.                                      VAR S:      UNIV Str255);
  268.                                                              
  269.     PROCEDURE ImmDataProc(ImmData: UNIV LongInt;
  270.                                                 VAR S:     UNIV Str255);
  271.                                          
  272.     or in C,
  273.     
  274.     pascal void PCRelProc(long Address, char *S)
  275.     
  276.     pascal void JTOffProc(short A5JTOffset, char *S)
  277.     
  278.     pascal void TrapNameProc(unsigned short TrapWord, char *S)
  279.     
  280.     pascal void AbsAddrProc(long AbsAddr, char *S)
  281.     
  282.     pascal void IdProc(LookupRegs BaseReg, long Offset, char *S)
  283.     
  284.     pascal void ImmDataProc(long ImmData, char *S)
  285.  
  286.     Note: InitLookup contains initialized data which requires initializing at load
  287.                 time (this is of concern only to users with assembler main programs).
  288. */
  289.  
  290.     
  291. pascal void Lookup(Ptr         PC,            /* Addr of extension/trap word                */
  292.                                      LookupRegs  BaseReg, /* Base register/lookup mode                  */
  293.                                      long        Opnd,        /* Trap word, PC addr, disp.                  */
  294.                                      char        *S);             /* Returned substitution                            */
  295.     /*
  296.     This is a standard Lookup proc available to the caller for calls to the
  297.     Disassembler.    If the caller elects to use this proc, then InitLookup MUST be
  298.     called prior to any calls to the Disassembler.  All the logic to determine the
  299.     type of lookup is done by this proc.  For PC-relative, Jump Table references,
  300.     A-traps, absolute addresses, and offsets from a base register, the associated
  301.     level 1 Pascal proc specified in the InitLookup call (if not NULL) is called.
  302.  
  303.     This scheme simplifies the Lookup mechanism by allowing the caller to deal
  304.     with just the problems related to the application.
  305.     */
  306.  
  307.  
  308. pascal void LookupTrapName(unsigned short TrapWord, char *S);
  309.     /*
  310.     This is a procedure provided to allow conversion of a trap instruction (in
  311.      TrapWord) to its corresponding trap name (in S).  It is provided primarily for
  312.      use with the Disassembler and its address may be passed to InitLookup above for
  313.      use by this unit's Lookup routine.  Alternatively, there is nothing prohibiting
  314.      the caller from using it directly for other purposes or by some other lookup
  315.      proc.
  316.  
  317.  Note: The tables in this proc make the size of this proc about 9500 bytes.  The
  318.              trap names are fully spelled out in upper and lower case.
  319.  */
  320.  
  321.  
  322. pascal void ModifyOperand(char *operand);
  323.     /*
  324.     Scan an operand string, i.e., the null terminated Pascal string returned by
  325.     the Disassembler (null MUST be present here) and modify negative hex values to
  326.     negated positive value. For example, $FFFF(A5) would be modified to -$0001(A5).
  327.   The operand to be processed is    passed as the function's parameter which is
  328.     edited "in place" and returned to the caller.
  329.  
  330.     This routine is essentially a pattern matcher and attempts to only modify 2, 4,
  331.     and 8 digit hex strings in the operand that "might" be offsets from a base
  332.     register.  If the matching tests are passed, the same number of original digits
  333.     are output (because that indicates a value's size -- byte, word, or long).
  334.  
  335.     For a hex string to be modified, the following tests must be passed:
  336.  
  337.     • There must have been exactly 2, 4, or 8 digits.
  338.  
  339.         Only hex strings $XX, $XXXX, and $XXXXXXXX are possible candidates because
  340.         that is the only way the Disassembler generates offsets.
  341.  
  342.     • Hex string must be delimited by a "(" or a ",".
  343.  
  344.         The "(" allows offsets for $XXXX(An,...) and $XX(An,Xn) addressing modes.
  345.         The comma allows for the MC68020 addressing forms.
  346.  
  347.     • The "$X..." must NOT be preceded by a "±".
  348.  
  349.         This eliminates the possibility of modifying the offset of a PC-relative
  350.         addressing mode always generated in the form "*±$XXXX".
  351.     
  352.     • The "$X..." must NOT be preceded by a "#".
  353.     
  354.         This eliminates modifying immediate data.
  355.  
  356.     • Value must be negative.
  357.  
  358.         Negative values are the only values we modify.  A value $FFFF is modified to
  359.         -$0001.
  360.     */
  361.     
  362.     
  363. extern char *validMacsBugSymbol(char *symStart, void *limit,
  364.                                                                 char *symbol);
  365.     /*
  366.     Check that the bytes pointed to by symStart represents a valid MacsBug symbol.
  367.     The symbol must be fully contained in the bytes starting at symStart, up to,
  368.     but not including, the byte pointed to by the limit parameter.
  369.     
  370.     If a valid symbol is NOT found, then NULL is returned as the function's result.
  371.     However, if a valid symbol is found, it is copied to symbol (if it is not NULL)
  372.     as a null terminated Pascal string, and return a pointer to where we think the
  373.     FOLLOWING module begins. In the "old style" cases (see below) this will always
  374.     be 8 or 16 bytes after the input symStart.  For new style Apple Pascal and C
  375.     cases this will depend on the symbol length, existence of a pad byte, and size
  376.     of the constant (literal) area.  In all cases, trailing blanks are removed from
  377.     the symbol.
  378.     
  379.     A valid MacsBug symbol consists of the characters '_', '%', spaces, digits, and
  380.     upper/lower case letters in a format determined by the first two bytes of the
  381.     symbol as follows:
  382.     
  383.      1st byte  | 2nd byte  |  Byte  |
  384.          Range   |  Range    | Length | Comments
  385.     ==============================================================================
  386.      $20 - $7F | $20 - $7F |    8   | "Old style" MacsBug symbol format
  387.      $A0 - $7F | $20 - $7F |    8   | "Old style" MacsBug symbol format
  388.     ------------------------------------------------------------------------------
  389.      $20 - $7F | $80 - $FF |   16   | "Old style" MacApp symbol ab==>b.a
  390.      $A0 - $7F | $80 - $FF |   16   | "Old style" MacApp symbol ab==>b.a
  391.     ------------------------------------------------------------------------------
  392.      $80       | $01 - $FF |    n   | n = 2nd byte       (Apple Compiler symbol)
  393.      $81 - $9F | $00 - $FF |    m   | m = 1st byte & $7F (Apple Compiler symbol)
  394.     ==============================================================================
  395.     
  396.     The formats are determined by whether bit 7 is set in the first and second
  397.     bytes.  This bit will removed when we find it or'ed into the first and/or
  398.     second valid symbol characters.
  399.     
  400.     The first two formats in the above table are the basic "old style" (pre-
  401.     existing) MacsBug formats. The first byte may or may not have bit 7 set the
  402.     second byte is a valid symbol character.  The first byte (with bit 7 removed)
  403.     and the next 7 bytes are assumed to comprise the symbol.
  404.     
  405.     The second pair of formats are also "old style" formats, but used for MacApp
  406.     symbols.  Bit 7 set in the second character indicates these formats. The symbol
  407.     is assumed to be 16 bytes with the second 8 bytes preceding the first 8 bytes
  408.     in the generated symbol.  For example, 12345678abcdefgh represents the symbol
  409.     abcdefgh.12345678.
  410.     
  411.     The last pair of formats are reserved by Apple and generated by the MPW Pascal
  412.     and C compilers.  In these cases the value of the first byte is always between
  413.     $80 and $9F, or with bit 7 removed, between $00 and $1F.  For $00, the second
  414.     byte is the length of the symbol with that many bytes following the second
  415.     byte (thus a max length of 255). Values $01 to $1F represent the length itself.
  416.     A pad byte may follow these variable length cases if the symbol does not end
  417.     on a word boundary.  Following the symbol and the possible pad byte is a word
  418.     containing the size of the constants (literals) generated by the compiler.
  419.     
  420.     Note that if symStart actually does point to a valid MacsBug symbol, then you
  421.     may use showMacsBugSymbol to convert the MacsBug symbol bytes to a string that
  422.     could be used as a DC.B operand for disassembly purposes.  This string
  423.     explicitly shows the MacsBug symbol encodings.
  424.     */
  425.  
  426.  
  427. extern char *endOfModule(void *address, void *limit, char *symbol,
  428.                                                  void **nextModule);
  429.     /*
  430.     Check to see if the specified memory address, contains a RTS, JMP (A0) or
  431.     RTD #n instruction immediately followed by a valid MacsBug symbol.  These
  432.     sequences are the only ones which can determine an end of module when MacsBug
  433.     symbols are present.  During the check, the instruction and its following
  434.     MacsBug symbol must be fully contained in the bytes starting at the specified
  435.     address parameter, up to, but not including, the byte pointed to by the limit
  436.     parameter.
  437.  
  438.     If the end of module is NOT found, then NULL is returned as the function's
  439.     result.  However, if a end of module is found, the MacsBug symbol is returned
  440.     in symbol (if it is not NULL) as a null terminated Pascal string (with trailing
  441.     blanks removed), and the functions returns the pointer to the start of the
  442.     MacsBug symbol (i.e., address+2 for RTS or JMP (A0) and address+4 for RTD #n).
  443.     This address may then be used as in input parameter to showMacsBugSymbol to
  444.     convert the MacsBug symbol to a Disassembler operand string.
  445.     
  446.     Also returned in nextModule is where we think the FOLLOWING module begins. In
  447.     the "old style" cases (see validMacsBugSymbol) this will always be 8 or 16
  448.     bytes after the input address.  For new style the Apple Pascal and C cases this
  449.     will depend on the symbol length, existence of a pad byte, and size of the
  450.     constant (literal) area.  See validMacsBugSymbol for a description of valid
  451.     MacsBug symbol formats. 
  452.     */
  453.     
  454.  
  455. extern char *showMacsBugSymbol(char *symStart, void *limit, char *operand,
  456.                                                              short *bytesUsed);
  457.     /*
  458.     Format a MacsBug symbol as a operand of a DC.B directive.  The first one or two
  459.     bytes of the symbol are generated as $80+'c' if they have there high high bits
  460.     set.  All other characters are shown as characters in a string constant.  The
  461.     pad byte, if present, is one is also shown as $00.
  462.     
  463.     This routine is called to check that the bytes pointed to by symStart represent
  464.     a valid MacsBug symbol.  The symbol must be fully contained in the bytes
  465.     starting at symStart, up to, but not including the byte pointed to by the limit
  466.     parameter.
  467.     
  468.     When called, showMacsBugSymbol assumes that symStart is pointing at a valid
  469.     MacsBug symbol as validated by the validMacsBugSymbol or endOfModule routines.
  470.     As with validMacsBugSymbol, the symbol must be fully contained in the bytes
  471.     starting at symStart up to, but not including, the byte pointed to by the end
  472.     parameter.
  473.     
  474.     The string is returned in the 'operand' parameter as a null terminated Pascal
  475.     string.  The function also returns a pointer to this string as its return
  476.     value (NULL is returned only if the byte pointed to by the limit parameter is
  477.     reached prior to processing the entire symbol -- which should not happen if
  478.     properly validated).  The number of bytes used for the symbol is returned in
  479.     bytesUsed.  Due to the way MacsBug symbols are encoded, bytesUsed may not
  480.     necessarily be the same as the length of the operand string.
  481.     
  482.     A valid MacsBug symbol consists of the characters '_', '%', spaces, digits, and
  483.     upper/lower case letters in a format determined by the first two bytes of the
  484.     symbol as described in the validMacsBugSymbol routine.
  485.     */
  486.  
  487. #ifdef __cplusplus
  488. }
  489. #endif
  490. #endif
  491.